package com.bosssoft.gateway.core.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

import static org.springframework.http.HttpStatus.BAD_GATEWAY;
/**
 * @class FuseController
 * @description  处理熔断的降级逻辑，通过网关的熔断降级统一这里处理
 * @author abel.zhan
 * @aate 2024-02-01  18:12
 * @version 1.0.0
 */
@Slf4j
@RestController
@RefreshScope
public class FuseController {

    /**
     *  返回统一应答 CommonResponse 提示服务熔断信息
     * @return
     */
    @RequestMapping("/hystrixFallback")
    public Object defaultFallback() {
        log.info("服务已被熔断");
        return new Object();
    }
}
